#pragma once
template<class T>
class Node {
public:
    Node() { _left = _right = _parent = 0;}
    Node(T t) { _data = t; }
    virtual ~Node() {}
    virtual bool operator==(Node<T>& node) const {
        return (_data == node.getData());
    }
    virtual bool operator!=(Node<T>& node) const {
        return (_data != node.getData());
    }
    virtual bool operator<=(Node<T>& node) const {
        return (_data <= node.getData());
    }
    virtual bool operator>(Node<T>& node) const {
        return (_data > node.getData());
    }
    virtual bool operator>=(Node<T>& node) const {
        return (_data >= node.getData());
    }
    virtual bool operator<(Node<T>& node) const {
        return (_data < node.getData());
    }

private:
    Node* _left;
    Node* _right;
    Node* _parent;
    T _data;
    
public:
    T& getData(void) { return _data; }
    T& data(void) { return _data; }
    void setData(T *pT) { *_data = *pT; }
    virtual Node* left() { return _left; }
    virtual Node* right() { return _right; }
    virtual Node* parent() { return _parent; }
    virtual void setLeft(Node* n) { _left = n; }
    virtual void setRight(Node* n) { _right= n; }
    virtual void setParent(Node* n) { _parent= n; }
};

